//
//  UIScreen+YKOCExection.m
//  YKOCExection
//
//  Created by edward on 2021/11/11.
//

#import "UIScreen+YKOCExection.h"

@implementation UIScreen (YKOCExection)

+ (CGRect)Bounds
{
    return [[UIScreen mainScreen] bounds];
}

+ (CGSize)Size
{
    return [[UIScreen mainScreen] bounds].size;
}

+ (CGFloat)Width
{
    return [self Size].width;
}

+ (CGFloat)Height
{
    return [self Size].height;
}

+ (CGFloat)Scale {
    return [UIScreen mainScreen].scale;
}

+ (CGFloat)onePixel {
    return (1.0 / [UIScreen mainScreen].scale);
}

+ (CGFloat)navigationBarHeight {
    return [self statusBarHeight] + 44.0;
}

+ (CGFloat)statusBarHeight {
    CGFloat height = [[UIApplication sharedApplication] statusBarFrame].size.height;
    return height;
}

+ (CGFloat)tabBarHeight {
    CGFloat tabbarH = 49;
    if (@available(iOS 11.0, *)) {
        tabbarH += [UIApplication sharedApplication].keyWindow.safeAreaInsets.bottom;
    }
    return tabbarH;
}


@end
